using System;
using System.Collections.Generic;
using System.Text;
using DAP;
using Dominio;

namespace Seguridad
{
    public class Dv
    {
        private PatRepository repository;

        public Dv()
        {
            repository = new PatRepository();
        }
        public bool calculateDVH()
        {
            bool result = true;
            IList<Patente> patenetes = repository.getPatList();

            foreach (Patente pat in patenetes)
            {
                int hash = 0;
                hash = pat.Country.GetHashCode() + pat.Id.GetHashCode();
                if (hash.ToString() != pat.Dvh)
                {
                    result = false;
                }
            }
            return result;
        }

    }
}
